package com.zyj.test.month1.day4;

/**
 * @author Yijia Zhang
 * @create 2024-04-25 23:23
 */
public class code2739 {
    public int distanceTraveled(int mainTank, int additionalTank) {
        int total = 0;
        while (mainTank >= 5) {
            mainTank -= 5;
            total += 50;
            if (additionalTank-- > 0) {
                mainTank++;
            }
        }
        return total + mainTank * 10;
    }
}
